package nan.priorityQueue;

import java.util.PriorityQueue;

public class Main {

    public static void main(String[] args) {
        PriorityQueue<Integer> queue=new PriorityQueue<>();//创建一个优先级队列
        int[] arr={9,5,3,7,6};
        for(int x:arr){
            queue.offer(x);
        }
        while (!queue.isEmpty()){
            Integer x=queue.poll();
            System.out.println(x);
        }
    }
}
